package YZ.Students.Mier.Tool.utils;

import org.mindrot.jbcrypt.BCrypt;

/**
 * @className: PasswordUtils
 * @author: shuishui
 * @date: 2022/12/03 9:00
 */
public class PasswordUtils {
    public static void main(String[] args) {
        String cc= "228257";
        String dd = hashPw("228257");
        String dpdd = hashPw("228257");
        boolean re = check(cc,dpdd);
        System.out.println(re);
    }
    public static String hashPw(String pw){
        return BCrypt.hashpw(pw,BCrypt.gensalt());
    }
    public static boolean check(String pw,String dbPw){
        return BCrypt.checkpw(pw,dbPw);
    }
}
